$(function () {
    page();
    load();
})

function page() {
    $("#tableSH").bootstrapTable({
        //请求方式  get请求中文会乱码，建议使用post请求
        method: 'post',
        //请求头部的设置
        contentType: 'application/json',
        //url
        url: '/Mmanufacture.do/MmanufactureWZYDengJiChaPage',
        //设置交替行样式
        striped: true,
        //初始显示页号
        pageNumber: 1,
        //设置表格高度
        //height: 350,
        //是否显示分页
        pagination: true,
        //设置是服务端分页还是客户端分页
        sidePagination: 'server',
        //页大小
        pageSize: 5,
        //分页列表
        pageList: [3, 5, 6, 10],
        //上传到服务端的参数
        queryParams: function (params) {
            let  productName=$("#productName").val();
            let  checkTime=$("#checkTime").val();
            return {
                num: params.offset / params.limit + 1,
                size: params.limit,
                obj: {productname:productName,checktime:checkTime}
            }
        },
        // 定义列名
        columns: [
            {title: "生产派工单编号", field: "manufactureid", align: "center"},
            {title: "产品编号", field: "productid", align: "center"},
            {title: "产品名称", field: "productname", align: "center"},
            {title: "数量", field: "amount", align: "center" },
            {title: "出库单编号合集", field: "applyidgroup", align: "center"},
            {title: "登记时间", field: "checktime", align: "center"},
            {
                title: "操作", field: "id", align: "center",
                formatter: function (vale, row, index) {
                    let account = JSON.stringify(row);
                    return "<button class=\"btn btn-primary\"  data-toggle=\"modal\" data-target=\"#exampleModal\" onclick='DengJi(" + account + ")'>登记</button>";
                }
            }
        ]
    })
    load();
}
// 刷新页面
function load() {
    $("#tableSH").bootstrapTable("refresh")
}

function DengJi(op) {
   localStorage.setItem("mManufactureInsideAdd",JSON.stringify(op));
   location.href="../../wen_zhi_yi/mManufactureInsideAdd(1).html";
}